<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
    <div class="box"><div>我被修改了</div></div>

<script>
    const box = document.querySelector(".box")
    console.log(box.innerText)

    // 不会解析标签
    box.innerText = "<div>我被修改了</div>"

    // 会解析标签
    box.innerHTML = "<h1>我变成了一级标题</h1>"
</script>

</body>
</html>